<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
 <div class="Wrapper">
        <div>
           <div id="pageInTab" class="pageInTab">
		   <div tabid="tabA" title="基本信息" lselected="true">
		<form id="fnc_prj_bsc_info_form" >
             <div class="fieldset1 tabel_col clearFix">
              <div class="fieldBox col_100">
                    <div class="label">项目名称</div>
                <div class="field">
                     <span id="fncprjnm" name="fncprjnm">&nbsp;${fncPrjBscInfo.fncprjnm}</span>
                </div>
                <div style="display: none">
                </div>
             </div>
             <div class="fieldBox col_50">
                <div class="label">金融机构</div>
                <div class="field">
                    <span id="fncinsNM" name="fncinsNM">&nbsp;${fncPrjBscInfo.fncinsNM}</span>
                </div>
                <div style="display: none">
                </div>
             </div>
                             <div class="fieldBox col_50">
                    <div class="label">金融机构类型</div>
                    <div class="field">
                    <span id="instypeNM" name="instypeNM">&nbsp;${fncPrjBscInfo.instypeNM}</span> 
                </div>
                <div style="display: none">
                </div>
             </div>
             <div class="fieldBox col_50">
                    <div class="label">融资报价</div>
                <div class="field">
                <span name="fncScmNm" id="fncScmNm" onclick="showScmDetail()" style="color:blue;text-decoration:underline">&nbsp;${fncPrjBscInfo.fncscmNM}</span>
                </div>
                <div style="display: none">
                </div>
             </div>
              <div class="fieldBox col_50">
                    <div class="label">方案XIRR(%)</div>
                <div class="field">
                    <span id="irr" name="irr">&nbsp;${fncPrjBscInfo.irr*100}</span>
                </div>
                <div style="display: none">
                </div>
             </div>     
           <div class="fieldBox col_50">
                    <div class="label">国家</div>
                <div class="field">
                  <span id="countryNM" name="countryNM">&nbsp;${fncPrjBscInfo.countryNM}</span>
                </div>
                <div style="display: none">
                </div>
             </div>
                
		 <div class="fieldBox col_50">
                <div class="label">业务类型</div>
                <div class="field">
                   <span id="bustypeNM" name="bustypeNM">&nbsp;${fncPrjBscInfo.bustypeNM}</span>
                </div>
                <div style="display: none">
                </div>
              </div>
          <div class="fieldBox col_50">
                    <div class="label">项目金额</div>
                <div class="field">
                    <span id="fncprjamt" name="fncprjamt">&nbsp;${fncPrjBscInfo.fncprjamt/100}</span>
                </div>
                <div style="display: none">
                </div>
             </div>   
              <div class="fieldBox col_50">
                    <div class="label">融资金额</div>
                <div class="field">
                    <span id="fncprjamt" name="fncprjamt">&nbsp;${fncPrjBscInfo.fncfiamt/100}</span>
                </div>
                <div style="display: none">
                </div>
             </div>  
                      
                 
              <div class="fieldBox col_50">
                    <div class="label">实际融资金额</div>
                <div class="field">
                    <input name="acFiAmt" id="acFiAmt" type="text" readonly="readonly" class="ui-textbox" value="${fncPrjBscInfo.acFiAmt/100.00}" onchange="changeAmt(this.value)" validate="{number:true,required:true}" >
                </div>
                <div style="display: none">
                </div>
             </div>  
                       
              <div class="fieldBox col_50">
                    <div class="label">实际XIRR(%)</div>
                <div class="field">
                    <input name="acXirr" id="acXirr"  readonly="readonly" type="text" class="ui-textbox" value="${fncPrjBscInfo.acXirr}" validate="{number:true,required:true}" >
                </div>
                <div style="display: none">
                </div>
             </div> 
             <div class="fieldBox col_50">
                    <div class="label">实际利率(%)</div>
                <div class="field">
                    <input name="scmIntrtReal" id="scmIntrtReal" readonly="readonly"  type="text" class="ui-textbox" value="${fncPrjBscInfo.scmIntrtReal*100}" validate="{number:true}" >
                </div>
             </div>
               <div class="fieldBox col_50">
                    <div class="label">久期值</div>
                <div class="field">
                    <input name="dura" id="dura"  readonly="readonly" type="text" class="ui-textbox" value="${fncPrjBscInfo.dura}" validate="{number:true,required:true}" >
                </div>
                <div style="display: none">
                </div>
             </div>    
                 <div class="fieldBox col_50">
                    <div class="label">首付款金额</div>
                <div class="field">
                    <input name="fstpyamtall" id="fstpyamtall" readonly="readonly" type="text" class="ui-textbox" value="${fncPrjBscInfo.fstpyamtall/100.00}" readonly="readonly" validate="{number:true,required:true}" >
                </div>
                <div style="display: none">
                </div>
             </div> 
              <div class="fieldBox col_50">
                    <div class="label">首付款是否坐扣</div>
                <div class="field">
                    <input name="wthrddctNM" id="wthrddctNM" readonly="readonly" type="text" class="ui-textbox" value="${fncPrjBscInfo.wthrddct}" readonly="readonly">
                </div>
                <div style="display: none">
                </div>
             </div>
             
             <div class="fieldBox col_50">
                    <div class="label">融资期数</div>
                <div class="field">
                    <input name="payplanpd" id="payplanpd" readonly="readonly" type="text" class="ui-textbox" value="${fncPrjBscInfo.payplanpd}" validate="{number:true,required:true}" >
                </div>
                <div style="display: none">
                </div>
             </div>          
             

             
              <div class="fieldBox col_50">
                    <div class="label">融资行数</div>
                <div class="field">
                    <input name="payplanli" id="payplanli" readonly="readonly"  type="text" class="ui-textbox" value="${fncPrjBscInfo.payplanli}"  validate="{number:true,required:true}" >
                <input name="prjid" id="prjid" type="hidden" class="ui-textbox" value="${id}">
                   <input name="maxli" id="maxli" type="hidden" class="ui-textbox" value="0">
                   <input name="maxpd" id="maxpd" type="hidden" class="ui-textbox" value="0">
                   <input name="flsum" id="flsum" type="hidden" class="ui-textbox" value="0">
                   <input name="paysum" id="paysum" type="hidden" class="ui-textbox" value="0">
                </div>
                <div style="display: none">
                </div>
             </div> 
             
             
             
             
             
             
             
             
             <div class="fieldBox col_50">
                    <div class="label">实际到账日期</div>
                <div class="field">
                    <span id="transtm" name="transtm">&nbsp;${fncPrjBscInfo.transtm}</span>                  
                </div>
                <div style="display: none">
                </div>
             </div>       
                <div class="fieldBox col_50">
                    <div class="label">实际到账金额</div>
                <div class="field">
                <span id="transam" name="transam">&nbsp;${fncPrjBscInfo.transam/100.00}</span>  
                </div>
                <div style="display: none">
                </div>
             </div> 
             
              
            </div>
             <div class="fieldset1 tabel_col tabel_col_s clearFix">
					<div class="caption">
						<span class="title">到账明细</span>
						
					</div>

					<div class="fieldBox col_100">
							<div id="cost3" class="sq-grid">
							</div>
					</div>
            </div>
               <div class="fieldset1 tabel_col tabel_col_s clearFix">
					<div class="caption">
						<span class="title">融资端费用信息 </span>
					</div>
					<div class="fieldBox col_100">
							<div id="cost0" class="sq-grid">
							</div>
					</div>
            </div>           
              <div class="fieldset1 tabel_col tabel_col_s clearFix">
					<div class="caption">
						<span class="title">还款表信息 </span>
						
					</div>
					<div class="fieldBox col_100">
							<div id="cost1" class="sq-grid">
							</div>
					</div>
					<!-- 附件显示 -->
					<div class="fieldBox col_100">
						<div style="width: 98%; margin-left: 1%;">
							<jsp:include page="../frCommFilesList.jsp" flush="true" ></jsp:include>
							<div id="ligergrid_file1" class="sq-grid"></div>
						</div>
					</div>
            </div>
   
     
            <!-- hide data -->
	        
         
        </form>
        </div>
              
        </div>
        </div>
    </div>
    
	<script type="text/javascript">
	  var pageInApp={
	    		flag:true
	    };
	  var griddata1;
	  var griddata0;
	  var id ='${id}';
	  var selectOrgCd = "";
	   var searchOrgTree = null;
	  var firstNode = null;
	  var textName='${orgTextName}';//节点名称
	  var orgData = null;
		var id ="";//初始值
		var detailFlag = '${detailFlag}';
		var isFlow = '${isFlow}';
		var editFlag='${editFlag}'
$(function () {
	initData();
	loadFilesLiger('hkb',1, $("#prjid").val(),'no');//加载还款表附件信息
});
	//初始化数据
	function initData(){
		//	initOrgTree();

			f_initCostData1();
			f_initCostData0();
			f_initCostData3();
		    initTab();
		    $("#fncprjamt").val(new  Number("${fncPrjBscInfo.fncprjamt/100}"));
		    $("#transam").val(new  Number("${fncPrjBscInfo.transam/100}"));
		    $("#acFiAmt").val(new  Number("${fncPrjBscInfo.acFiAmt/100}"));
		    $("#fstpyamt").val(new  Number("${fncPrjBscInfo.fstpyamt/100}"));
		    $("#transam").html(new  Number("${fncPrjBscInfo.transam/100}"));
		    $("#acXirr").val(new  Number("${fncPrjBscInfo.acXirr*100}"));
		    $("#fstpyamtall").val(new  Number("${fncPrjBscInfo.fstpyamtall/100}"));
		    
		 if($("#wthrddctNM").val()==1){
			 $("#wthrddctNM").val("是");
		 }else if($("#wthrddctNM").val()==2){
			 $("#wthrddctNM").val("是/否");
		 }else{
			 $("#wthrddctNM").val("否");
		 }
			$("#fnc_prj_bsc_info_form").ligerForm({
			    validate: true
			});
			 var ligerForm = liger.get("fnc_prj_bsc_info_form");
		 $("#fnc_prj_bsc_info_form").check_ligerFormEditor();
		
		/*  // 设置业务种类默认为禁用
		    var slt=liger.get("loanTypCd");
            slt.setDisabled();
 */
	
		
		 $(function() {
				
				var transtm ="${fncPrjBscInfo.transtm}";
				if(null != transtm&&transtm!=''){
					var date = new Date(transtm);
					$("#transtm").text(DateUtils.formatDate(date, DateUtils.YYYY_MM_DD));
				}
		        
			});
	

	}
	var pageInTab = null;
	  var loadedTabs=[]

	
	  

	  
   
	
	//初始化Tab
    function initTab(){
    	 pageInTab = $("#pageInTab").ligerTab({
             height: 'auto',
             contextmenu: false,
             minIframeHeight: GET_minIframeHeight(),
             onBeforeSelectTabItem: function (tabid) {
             	var id = $("#prjid").val();
             		//alert("id="+id);
             	 if(tabid!="tabA"){
 	             	if(id==null||id==''){
 	                	top.$.ligerDialog.SQalert({content:"请先保存项目基本信息", SQ_type: "warning"});
 	                	return false;
 	                } 
             	} 
             },
             onAfterSelectTabItem: function(tabid) {
              //   if (loadedTabs.indexOf(tabid)<0) {
                 	var id = $("#prjid").val();
                 	//alert("id="+id);
                 	 if(tabid!="tabA"){
 	                	if(id==null||id==''){
 	                		 top.$.ligerDialog.SQalert({content: LogUtils.LOG_PRJ__PRD_SELECT_BEFORE, SQ_type: "warning"});
 	                         return false; //验证不通过，不执行以下代码
 	                	}
                 	} 
                     loadedTabs.push(tabid);
                   //  switch (tabid){
                   //      case "tabB":
                           //  pageInTab.setTabItemSrc(tabid, "<%=path%>/rfbuss/fncprjbscinfo/toSysscoreIdxListPage.do?id="+id+"&&detailFlag="+detailFlag);
                   //          break;
                        
                             
                   //  }
            //     };
                 SetIframe_height();
             }
         });

         $.extend(true, pageInApp, {
             pageInTab: pageInTab
         });
    };
	//保存项目基础信息
	function save(){
        var ligerForm = liger.get("fnc_prj_bsc_info_form");
        if (!ligerForm.valid()) {
            top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
            return false; //验证不通过，不执行以下代码
        }
        var paysum=new Number($("#paysum").val());
        var flsum=new Number($("#flsum").val());
        var transam=new Number("${fncPrjBscInfo.transam/100.00}");
        var wthrddctNM=$("#wthrddctNM").val();
        var fstpyamt=new Number($("#fstpyamt").val());
      //  alert(transam-(paysum+flsum));
        if(wthrddctNM=="坐扣"){
        	//alert(transam);
        	//alert(paysum);
        	//alert(flsum);
        	//alert(transam-(paysum+flsum));
        	if(transam!=(paysum+flsum)){
                top.$.ligerDialog.SQalert({content:"融资端金额与还款明细金额总合必须 等于："+transam,SQ_type: "warning"});
                return false; 	
        	}
        }else{
         	if((transam-fstpyamt)!=(paysum+flsum)){
                top.$.ligerDialog.SQalert({content:"融资端金额与还款明细金额总合必须 等于："+(transam-fstpyamt),SQ_type: "warning"});
                return false; 	
        	}
        }

	    				  var data = ligerForm.getData();
	    			       data["id"]=$("#prjid").val();
	    			       if(data["orgCd"]==""){
	    			       data["orgCd"]='${orgCd}';
	    			       }
	    			       var payplanlist = griddata1.getData();
	    			       var fllist = griddata0.getData();
	    			       data["payplanlist"] = JSON.stringify(payplanlist);
	    			       data["fllist"] = JSON.stringify(fllist);
	    			        var url = '<%=path%>/rfbuss/fncprjbscinfo/payplanadd.do';

	    			        var wait_dialog;
	    			        $.ajax({
	    			    		type: 'post',
	    			    		dataType:'json',
	    			    		data:data,
	    			    		url: url,
	    			    		beforeSend: function(){
	    					          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
	    					     },
	    			    		success:function(msg){
	    			    			 wait_dialog.close();
	    			    			 if(msg.success == 1){
	    			    					 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
	    						          	 	$("#prjid").val(msg.data);
	    						          	 	pageInApp.flag=false;
	    			    			 }else{
	    			    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
	    			    			 }
	    			    		}
	    			    	});
     	    	
	}
	//取消
	function cancelBtn(){
		  var TAB=top.mainApp.parentTab;
          var currentTabid=TAB.getSelectedTabItemID();
		 top.tab.removeTabItem(currentTabid);
	}
	  function f_initCostData1()
	    { 
			if(editFlag==''){
				editFlag=true;
			}
			var id=$("#prjid").val();
			var url='<%=path%>/rfbuss/fncprjbscinfo/initpayplanList.do?id='+id;
	    	griddata1 = $("#cost1").ligerGrid({
	    		url:url,
	            method: 'get',
	                columns: [
	                	
		                { display: '行数', width: 100, name: 'lineNum',editor: { type: 'text' },
		                	render:function(item, rowindex){
		                		item.lineNum=rowindex+1;
		                		return item.lineNum;
		                	},
		                	 totalSummary:
			                    {
			                        render: function (suminf, column, cell)
			                        {
			                        	//alert(suminf.count+":"+suminf.sum);
			                        	$("#maxli").val(suminf.count);
			                        	
			                     
			                            return '<div>总共:' + suminf.count + '</div>';
			                        },
			                        align: 'left'
			                    }
		              
		                },
		                { display: '期数', width: 100, name: 'pdMun',editor: { type: 'text' },
		                	totalSummary:
		                    {
		                        render: function (suminf, column, cell)
		                        {
		                        	//alert(suminf.count+":"+suminf.sum);
		                        	$("#maxpd").val(suminf.max); 
		                        	
		                            return '<div>总计:' + suminf.max + '</div>';
		                        },
		                        align: 'left'
		                    }
		                
		                },
		                
		                { display: '归集日期', name: 'imputDate', width: 150,format: 'yyyy-MM-dd', editor: { type: 'date'},render:renderDate }, 
		                { display: '还款日期', name: 'repayDate',format: 'yyyy-MM-dd', width: 150, editor: { type: 'date'},render:renderDate },
		                { display: '租金', name: 'rental',
		                	 render: function (rowdata, rowindex, value, column) { 
				            		
		                		 var h = '';
			            			if(value&&value!="null"){
			            		    h+=fmoney(value, 2);
			            			}else{
			            				h+=0.00;
			            			}
			                        return h;
				            		},
		                    editor: { type: 'text' }, align: 'left', width: 120,totalSummary:
		                    {
		                        render: function (suminf, column, cell)
		                        {
		                        	//alert(suminf.count+":"+suminf.sum);
		                        	//$("#maxpd").val(suminf.max); 
		                        	
		                            return '<div>总计:' + suminf.sum.toFixed(2) + '</div>';
		                        },
		                        align: 'left'
		                    }
		                },
		                { display: '本金', name: 'capital',
		                	 render: function (rowdata, rowindex, value, column) { 
				            		
		                		 var h = '';
			            			if(value&&value!="null"){
			            		    h+=fmoney(value, 2);
			            			}else{
			            				h+=0.00;
			            			}
			                        return h;
				            		},
		                    editor: { type: 'text' }, align: 'left', width: 120,totalSummary:
		                    {
		                        render: function (suminf, column, cell)
		                        {
		                        	//alert(suminf.count+":"+suminf.sum);
		                        	
		                        	$("#paysum").val(suminf.sum); 
		                        	
		                            return '<div>总共:' + suminf.sum.toFixed(2) + '</div>';
		                        },
		                        align: 'left'
		                    }
		                },
		                { display: '利息', name: 'interest',
		                	 render: function (rowdata, rowindex, value, column) { 
				            		
		                		 var h = '';
			            			if(value&&value!="null"){
			            		    h+=fmoney(value, 2);
			            			}else{
			            				h+=0.00;
			            			}
			                        return h;
				            		},
		                    editor: { type: 'text' }, align: 'left', width: 120
		                },
		                { display: '其他费用', name: 'otherChar',
		                	 render: function (rowdata, rowindex, value, column) { 
				            		
		                		 var h = '';
			            			if(value&&value!="null"){
			            		    h+=fmoney(value, 2);
			            			}else{
			            				h+=0.00;
			            			}
			                        return h;
				            		},
		                    editor: { type: 'text' }, align: 'left', width: 120
		                },
		                { display: '超额抵押', name: 'overColl',
		                    editor: { type: 'text' }, align: 'left', width: 120
		                },
		                { display: '剩余本金', name: 'reCapital',
		                	 render: function (rowdata, rowindex, value, column) { 
				            		
		                		 var h = '';
			            			if(value&&value!="null"){
			            		    h+=fmoney(value, 2);
			            			}else{
			            				h+=0.00;
			            			}
			                        return h;
				            		},
		                    editor: { type: 'text' }, align: 'left', width: 150
		                },	
		                { display: '预计退回时间', name: 'reReturnTm',format: 'yyyy-MM-dd', width: 150, editor: { type: 'date'},render:renderDate},
	                ],
	                onSelectRow: function (rowdata, rowindex)
	                {
	                   // $("#txtrowindex").val(rowindex);
	                },
	                onBeforeEdit: function(e){

	                    var colNanme = e.column.columnname;
	                    //if (colNanme == "costNm" || colNanme == "lineNum") {
	    	            
                       	   e.column.editor.readonly = true;
                       //   }
	                         //e.column.editor.readonly = false;
	                         
	                    
	                    },
	                usePager: false,
	                root: 'rows',
	                record: 'total',
	                hideLoadButton: true,
	                width: '100%',
	                height: 300,
	                heightDiff: -2,
	                enabledEdit: editFlag,
	                isScroll: false,
	                checkbox: editFlag,
	                rownumbers: true,
	                allowUnSelectRow: true,
	                alternatingRow: false,
	                enabledSort: false
	            }); 
	    	
	    	
	    }
	  $("#scm_cost2_add_btn_id").click(function (event) {
		  griddata1.addRow({});
		  
		//  var mli=parseInt($("#maxli").val());
      //	var pli=parseInt($("#payplanli").val())
      //	var pd=parseInt($("#payplanpd").val())
      //	if(mli>pli){
	    	//	alert("true");
      		$("#payplanli").val($("#maxli").val());
	    //	}
      	
      	
	    });
	    
		$("#scm_cost2_del_btn_id").click(function (event) {
	        var selectedRows = griddata1.getSelectedRows();
	        if(selectedRows.length ==0){
				$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_SELECT_ONLY_A_ROW, SQ_type: "warring"});
				return;
			}
			
			
	        griddata1.deleteSelectedRow();
	        setTimeout(function () {  
	        	 $("#payplanli").val($("#maxli").val());
	        }, 500);  
	       
	    });
		
		//格式化时间
		function renderDate(rowdata, index, value){
			var dateStr = "";
			if(null != value){
				var date = new Date(value);
				dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
			}
			return dateStr;
		}
		
		
		function f_initCostData0()
	    { 
			if(editFlag==''){
				editFlag=true;
			}
			var id=$("#prjid").val();
			var url='<%=path%>/rfbuss/fncprjbscinfo/initchgrList.do?id='+id;
	    	griddata0 = $("#cost0").ligerGrid({
	    		url:url,
	            method: 'get',
	                columns: [
	                	
		                { display: '行数', width: 100, name: 'lineNum',editor: { type: 'text' },
		                	render:function(item, rowindex){
		                		item.lineNum=rowindex+1;
		                		return item.lineNum;
		                	},
		                	 totalSummary:
			                    {
			                        render: function (suminf, column, cell)
			                        {	                        	
			                            return '<div>总共:' + suminf.count + '</div>';
			                        },
			                        align: 'left'
			                    }
		              
		                },		                
		                { display: '费用名称', name: 'costNm', width: 350, editor: { type: 'text'}}, 
		                { display: '还款日期', name: 'repayDate',format: 'yyyy-MM-dd', width: 200, editor: { type: 'date'},render:renderDate },
		                { display: '费用比例', name: 'costPct',
		                    editor: { type: 'text' }, width: 200,render:function (rowdata, rowindex, value, column) { 
			            		var h="";
			            		if(null!=value && value>0){
			            		     h=value+"%";	
			            		}else{
			            			h="--"
			            		}
			            	return h;
			                
			            		},
		                },
		                { display: '费用金额', name: 'capital',
		                	 render: function (rowdata, rowindex, value, column) { 
				            		
		                		 var h = '';
			            			if(value&&value!="null"){
			            		    h+=fmoney(value, 2);
			            			}else{
			            				h+=0.00;
			            			}
			                        return h;
				            		},
		                    editor: { type: 'text' }, align: 'left', width: 320,totalSummary:
		                    {
		                        render: function (suminf, column, cell)
		                        {
		                        	//alert(suminf.count+":"+suminf.sum);
		                        	$("#flsum").val(suminf.sum); 
		                        	
		                            return '<div>总共:' + suminf.sum.toFixed(2) + '</div>';
		                        },
		                        align: 'left'
		                    }
		                },
		                       
	                ],
	                onSelectRow: function (rowdata, rowindex)
	                {
	                   // $("#txtrowindex").val(rowindex);
	                },
	                
	             
	                onBeforeEdit: function(e){

	                    var colNanme = e.column.columnname;
	                    //if (colNanme == "costNm" || colNanme == "lineNum") {
	    	            
                       	   e.column.editor.readonly = true;
                       //   }
	                         //e.column.editor.readonly = false;
	                         
	                    
	                    },
	                usePager: false,
	                root: 'rows',
	                record: 'total',
	                hideLoadButton: true,
	                width: '100%',
	                height: 300,
	                heightDiff: -2,
	                enabledEdit: editFlag,
	                isScroll: false,
	                checkbox: editFlag,
	                rownumbers: true,
	                allowUnSelectRow: true,
	                alternatingRow: false,
	                enabledSort: false
	            }); 
	    	
	    	
	    }
		//查看融资方案
		function showScmDetail(){
			var _id="${fncPrjBscInfo.fncscmid}";
			Add_navTab('PrdSpl_1'+_id,'查看融资方案','<%=path%>/rfbase/scmbaseinfo/toDetail.do?id='+_id);
		}
		
		 function f_initCostData3()
		    { 
				if(editFlag==''){
					editFlag=true;
				}
				var id=$("#prjid").val();
				var url='<%=path%>/rfbuss/fncprjdrawmon/initList.do?id='+id;
		    	griddata1 = $("#cost3").ligerGrid({
		    		url:url,
		            method: 'get',
		                columns: [

			                { display: '到账日期', name: 'dmTm', width: 250,format: 'yyyy-MM-dd', editor: { type: 'date'},render:renderDate }, 
			            
			                { display: '到账金额', name: 'dmAm',
			                	 render: function (rowdata, rowindex, value, column) { 
					            		
			                		 var h = '';
				            			if(value&&value!="null"){
				            		    h+=fmoney(value, 2);
				            			}else{
				            				h+=0.00;
				            			}
				                        return h;
					            		},
			                    editor: { type: 'text' }, align: 'left', width: 280,totalSummary:
			                    {
			                        render: function (suminf, column, cell)
			                        {
			                        	//alert(suminf.count+":"+suminf.sum);
			                        	$("#transanttem").val(suminf.sum); 
			                        	
			                            return '<div>总计:' + suminf.sum.toFixed(2) + '</div>';
			                        },
			                        align: 'right'
			                    }
			                },
			                { display: '收款银行', name: 'dueBank',
			                    editor: { type: 'text',readonly:true  }, align: 'left', width: 580
			                },
			                { display: '收款账号', name: 'dmAcc', 
			                    editor: { type: 'text',readonly:true }, align: 'left', width: 200
			                },
			                { display: '账号编号', name: 'accId',hide: true, 
			                    editor: { type: 'text' }, align: 'left', width: 180
			                }			               
			                
			               // getOptColumn()
		                ],
		                onSelectRow: function (rowdata, rowindex)
		                {
		                   // $("#txtrowindex").val(rowindex);
		                },
		                usePager: false,
		                root: 'rows',
		                record: 'total',
		                hideLoadButton: true,
		                width: '100%',
		                height: 300,
		                heightDiff: -2,
		                enabledEdit: false,
		                isScroll: false,
		                checkbox: editFlag,
		                rownumbers: true,
		                allowUnSelectRow: true,
		                alternatingRow: false,
		                enabledSort: false
		               
		            }); 
		    	
		    	
		    }
		 
		 function fmoney(s, n)   
			{   
			   n = n > 0 && n <= 20 ? n : 2;   
			   s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";   
			   var l = s.split(".")[0].split("").reverse(),   
			   r = s.split(".")[1];   
			   t = "";   
			   for(i = 0; i < l.length; i ++ )   
			   {   
			      t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");   
			   }   
			   return t.split("").reverse().join("") + "." + r;   
			} 
    </script>

</body>
</html>